//
//  LGSSheetController.h
//  LogicSim
//
//  Created by Jeremy Pereira on 29/04/2012.
//  Copyright (c) 2013 Jeremy Pereira. All rights reserved.
//

/*!
 *  @file
 *  @brief Base class for variou sheet controllers.
 *  @author Jeremy Pereira
 */
#import <Foundation/Foundation.h>

@protocol LGSSheetDelegate;

/*!
 *  @brief Base class containing common functionality for various sheet 
 *  controllers.
 */
@interface LGSSheetController : NSObject
/*!
 *  @brief The window that this controller controls.
 */
@property (strong) IBOutlet NSWindow* sheet;

/*!
 *  @brief show the sheet and attach it to a window as specified by the delegate.
 *
 *  @param newDelegate Delegate for this object.
 */
-(void) showWithDelegate: (id<LGSSheetDelegate>) newDelegate;

/*!
 *  @brief The delegate of this controller 
 */
@property (readonly, weak) id<LGSSheetDelegate> delegate;

/*!
 *  @brief Sent when the sheet will be closed.
 *  @param sender Object that sent the action.
 *  @return Nothing
 */
-(IBAction) closeSheet: (id)sender;
/*!
 *  @brief Sent when the sheet will be canceled.
 *  @param sender Object that sent the action.
 *  @return Nothing
 */
-(IBAction) cancelSheet: (id)sender;

/*!
 *  @brief Override this to set up any stuff for the user interface.
 *
 *  This method is invoked just before running the sheet.  You can override it
 *  ro set up popups etc.
 */
-(void) setUpUI;

/*!
 *  @brief inform the delegate the sheet has ended.
 *
 *  Invoked when the sheet has ended but not by being canceled.  Override this 
 *  to have the delagate do whatever is needed after the sheet has ended.
 */
-(void) informDelegateOfEndSheet;

@end
